﻿@{
    ViewBag.Title = "检验申请单";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<div class="ui-layout" id="layout" style="height:100%;width:100%;">
    <iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
            scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>
<script type="text/javascript">
    var reportServerHOST = '@(ViewBag.ReportServerHOST)';
    var orgId = '@(ViewBag.OrgId)';
    var thisorgId = '@(ViewBag.OrgId)';
    var curUsergh = '@(ViewBag.curUsergh)';
    var mzh = $.request('mzh');
    var cfId = $.request('cfId');
    //var uri = '/ReportServer/Pages/ReportViewer.aspx?%2fNewtouch.Report.1%2f%e5%ba%b7%e5%a4%8d%e5%a4%84%e6%96%b9%e5%8d%95&rs:Command=Render';
    var uri = "ReportServer/Pages/ReportViewer.aspx?%2fNewtouch.Report.1%2f%e6%a3%80%e6%9f%a5%e7%94%b3%e8%af%b7%e5%8d%95&rs:Command=Render"


    $(function () {

        submit();
    });

    function submit() {
        var url = getUrl();

        //直接打开
        location.href = url;
        return;

        setTimeout("$.loading(true, '正在请求报表页面...');", 10);
        $("#iframerightiframerightiframerightttt").attr('src', url);
    }

    $("#iframerightiframerightiframerightttt").load(function (responseTxt, statusTxt, xhr) {
        $.loading(false);
    });

    $(function () {
        var h = $(window).height();
        $('#layout iframe').css('height', h);
    });

    function getUrl() {
        if (uri.StartWith('/')) {
            uri = uri.substr(1);
        }
        var srcUrl = uri;
        srcUrl = reportServerHOST + srcUrl;

        //获取自定义样式
        if (true) {
            if (srcUrl.indexOf('&rc:') == -1) {
                srcUrl += "&rc:Stylesheet=MyStyleSheetBlankPage";
            }
        }
        if (true) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "orgId=";
            srcUrl += orgId;
        }
        if (true) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "mzh=";
            srcUrl += mzh;
        }
        if (true) {
            if (srcUrl.indexOf('&rs:') == -1) {
                srcUrl += "&rs:";
            }
            else {
                srcUrl += "&";
            }
            srcUrl += "cfId=";
            srcUrl += cfId;
        }
        return srcUrl;
    }
</script>


